package com.myzl.web.controller.coal;

import com.myzl.coal.service.AiShowService;
import com.myzl.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Administrator
 */
@RestController
@RequestMapping("/coal/aiShow")
public class AiShowController {

    @Autowired
    private AiShowService aiShowService;
    /**
     * 查询文件
     */
    @PreAuthorize("@ss.hasPermi('coal:aiShow:list')")
    @GetMapping("/list")
    public AjaxResult list()
    {
        return aiShowService.getImages();
    }

    @GetMapping(value = "/getImage/{index}")
    public AjaxResult getImage(@PathVariable("index") Integer index)
    {
        return aiShowService.getImage(index);
    }

    @GetMapping(value = "/aiRecognition/{index}")
    public AjaxResult aiRecognition(@PathVariable("index") Integer index)
    {
        return aiShowService.aiRecognition(index);
    }
}
